package com.springboot.fwwb09.controller;

import com.springboot.fwwb09.entity.underground;
import com.springboot.fwwb09.service.undergroundService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("underground")
@CrossOrigin
public class undergroundController {
    @Autowired
    private undergroundService undergroundService;
    //    查询所有的方法
    @GetMapping("findAll")
    public List<underground> findAll() {
        List<underground> underground = undergroundService.findAll();
        return underground;

    }

}
